package com.example.mymvp.view.ui.activity;


import com.example.mymvp.view.callback.BaseModelCallback;
import com.example.mymvp.view.model.BaseModel;
import com.example.mymvp.view.presenter.BasePresenter;
import com.example.mymvp.view.view.BaseView;

import io.reactivex.internal.observers.BlockingMultiObserver;

/**
 * 项目名：Shopping
 * 包名：  com.example.liangxq.ui.activity
 * 文件名：BaseMvpActivity
 * 创建者：liangxq
 * 创建时间：2021/3/16  11:22
 * 描述：TODO
 */
public abstract class BaseMvpActivity<V extends BaseView,M extends BaseModel,P extends BasePresenter<V,M>> extends BaseActivity {
    public  P mPresenter;
    @Override
    protected void initData() {
        mPresenter=createPresenter();
        if(mPresenter!=null){
            mPresenter.bindView((V) this);

        }
        initEvent();
    }
    protected abstract void initEvent();



    protected abstract P createPresenter();


    @Override
    protected void onDestroy() {
        super.onDestroy();
        if(mPresenter!=null){
            mPresenter.destoryView();
            mPresenter=null;
        }
    }
}
